﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using MP.LayerHelper.MP_OBS.DAL.EntityClasses;
using MP.LayerHelper.MP_OBS.BLL;
using MP.LayerHelper.MP_OBS.DAL.EntityClasses;
using MP.LayerHelper.MP_OBS.BLL;

public partial class Member_Control_AddMember : MP.Core.Authentication.Control.AuthenBase
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
    {
        CreateUserWizard a = (CreateUserWizard)sender;
        AspnetUsersEntity user = AspnetUsersManager.CreateInstant().GetByUserName(a.UserName);
        if (user != null)
        {
            HrEmployeeEntity emp = new HrEmployeeEntity();
            emp.Id = user.UserId;
            emp.EmployeeId = "*" + Guid.NewGuid() + "*";
            emp.WindowsUser = user.UserName;
            emp.AgentNumber = ((TextBox)a.CreateUserStep.ContentTemplateContainer.FindControl("txtAgentNumber")).Text;
            HrEmployeeManager.CreateInstant().Insert(emp);
        }
       
    }
}
